//
//  FilmCommentModel.m
//  觅影
//
//  Created by Zeus on 16/4/11.
//  Copyright © 2016年  陶虹. All rights reserved.
//

#import "FilmCommentModel.h"

@implementation FilmCommentModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}
- (NSMutableArray *)modelConfigureJsonDic:(NSMutableDictionary *)jsonDic
{
    NSMutableDictionary *resultDic = jsonDic[@"result"];
    NSMutableArray *dataArray = resultDic[@"data"];
    NSMutableArray *modelArray = [NSMutableArray array];
    for (NSMutableDictionary *dataDic in dataArray) {
        FilmCommentModel *model = [[FilmCommentModel alloc]init];
        [model setValue:resultDic[@"count"] forKey:@"count"];
        [model setValuesForKeysWithDictionary:dataDic];
        model.focusesArray = [NSMutableArray array];
        NSMutableArray *focusesArray = dataDic[@"foucuses"];
        for (NSMutableDictionary *focusesDic in focusesArray) {
            focusModel *focus = [[focusModel alloc]init];
            [focus setValuesForKeysWithDictionary:focusesDic];
            [model.focusesArray addObject:focus];
        }
        NSMutableArray *tagsArray = dataDic[@"tags"];
        for (NSMutableDictionary *tagsDic in tagsArray) {
            focusModel *focus = [[focusModel alloc]init];
            [focus setValuesForKeysWithDictionary:tagsDic];
            [model.focusesArray addObject:focus];
        }
        [modelArray addObject:model];
    }
    return modelArray;
}
@end
